<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('积分流水列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>积分类型：</label>
                            <select name="pointType" th:with="type=${@dict.getType('points_detail_point_type')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <label style="width: 105px;">积分来源者类型：</label>
                            <select name="sourceType" th:with="type=${@dict.getType('points_detail_people_type')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <label style="width: 105px;">积分获得者类型：</label>
                            <select name="winnerType" th:with="type=${@dict.getType('points_detail_people_type')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>

                        <li class="select-time">
                            <label style="width: 105px;">申请时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="startTime"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="endTime"/>
                        </li>


                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:pointsDetail:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:pointsDetail:remove')}]];
    var pointTypeDatas = [[${@dict.getType('points_detail_point_type')}]];
    var sourceTypeDatas = [[${@dict.getType('points_detail_people_type')}]];
    var winnerTypeDatas = [[${@dict.getType('points_detail_people_type')}]];
    var prefix = ctx + "system/pointsDetail";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "积分流水",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'sourceType',
                    title: '积分来源者类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(sourceTypeDatas, value);
                    }
                },
                {
                    field: 'sourceName',
                    title: '积分来源者'
                },
                {
                    field: 'pointType',
                    title: '积分类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(pointTypeDatas, value);
                    }
                },
                {
                    field: 'points',
                    title: '积分'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'winnerType',
                    title: '积分获得者类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(winnerTypeDatas, value);
                    }
                },
                {
                    field: 'winnerName',
                    title: '积分获得者'
                },
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>